﻿namespace OboutInc.TextMenu.Designer
{
    using OboutInc.TextMenu;
    using System;
    using System.Text;
    using System.Web.UI.Design;

    public sealed class TextMenuDesigner : ControlDesigner
    {
        public override string GetDesignTimeHtml()
        {
            try
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("<div style=\"border:1px solid black; padding: 2px; width:200; background-color:#EEEEEE; text-align: center; vertical-align: middle;\">");
                builder.Append("<font style=\"font-family: Tahoma; font-size: 11px;\">" + ((OboutInc.TextMenu.TextMenu) base.Component).ID + "<br>OboutInc TextMenu v" + ((OboutInc.TextMenu.TextMenu) base.Component).ComponentVersion + "</font>");
                builder.Append("</div>");
                return builder.ToString();
            }
            catch (Exception exception)
            {
                return this.GetErrorDesignTimeHtml(exception);
            }
        }

        protected override string GetErrorDesignTimeHtml(Exception e)
        {
            return base.CreatePlaceHolderDesignTimeHtml(e.Message);
        }
    }
}

